package utils

import (
	"crypto/md5"
	"encoding/hex"
	"fmt"
)

func GetMd5String(data interface{})string{
	var (
		toDealData []byte
	)
	switch data.(type) {
	case []byte:
		toDealData = data.([]byte)
	case string:
		toDealData = []byte(data.(string))
	}
	h := md5.New()
	h.Write(toDealData)
	cipherStr := h.Sum(nil)
	return fmt.Sprintf("%s", hex.EncodeToString(cipherStr))
}
